package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.model.user.UserInfo;
import com.atguigu.gmall.user.client.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

@Controller
public class LoginController {



    @GetMapping("/login.html")
    public String login(String originUrl, Model model){
        try {
            String encodeOriginUrl = URLEncoder.encode(originUrl, "utf-8");
            model.addAttribute("originUrl",encodeOriginUrl);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

         return "login";
    }


}
